<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@page import="com.mytrip.model.Trip" import="com.mytrip.model.TripPlan" import="com.mytrip.model.TripPlanFlight" import="com.mytrip.model.TripPlanHotel" import="com.mytrip.model.TripPlanMeeting" import="com.mytrip.model.TripPlanNote"%>
<%@page import="java.util.*" import="java.text.SimpleDateFormat"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>出发吧</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<jsp:include page="/common/include_js.jsp" />
<script type="text/javascript" src="<%=request.getContextPath() %>/js/My97DatePicker/WdatePicker.js"></script>
<script type="text/javascript" src="<%=request.getContextPath() %>/js/bsn.AutoSuggest_2.1.3.js"></script>
<link rel="stylesheet" type="text/css" media="screen" href="<%=request.getContextPath() %>/front/css/css.css" />
<link rel="stylesheet" type="text/css" media="screen" href="<%=request.getContextPath() %>/css/autosuggest_inquisitor.css" />
<style type="text/css">
._plan_notify{color:red;}
</style>
</head>
<body>
<div id="wrap">
  <jsp:include page="include/top.jsp">
  	<jsp:param name="t" value="2" />
  </jsp:include>

  <div id="main">
    <div id="main_left">
      <jsp:include page="include/tripStep.jsp" />
      
	  <%
	  	SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
	  	Trip trip = (Trip)request.getAttribute("trip");
	  	Date startDate = trip.getStartDate();
	  	Date endDate = trip.getEndDate();
	  %>
      
      <div class="colWdt4-3" id="planListDiv">
        <div class="fLt"> <a href="#"><img src="<%=request.getContextPath() %>/front/images/general.jpg" id="display_image" alt="Your trip" class="photoFrame"></a></div>
        <div class="fLt dubHMrgL">
          <h1><%=trip.getName() %>&nbsp;(<%=trip.getFromCityStr()%> ~ <%=trip.getToCityStr()%>)&nbsp;<span style="color:red;"><%if(!"1".equals(trip.getIsPublic())){out.print("私有行程");}%></span></h1>
          <div><%=sdf.format(trip.getStartDate())%> ~ <%=sdf.format(trip.getEndDate()) %></div>
          <div class="ContPad">
          	<a href="javascript:void(0);" onclick="javascript:goPrint();" class="btn_std"><img  src="<%=request.getContextPath() %>/front/images/printer.gif" /> 打印行程</a>
          </div>
        </div>
        <div class="clrBr"></div>
        
        <!-- <div class="trip_day">
        
          <div class="bgBlu TripPad">
            <div class="fLt" style="width:150px">2011年11月6日</div>
            <div style="width: 350px;" class="fLt"> [天气预报] </div>
          </div>
          
          <div class="trip_item blue">
            <div class="bgWht">
              <div class="wht">
                <div class="fLt ">
                  <h1><a href="javascript:void(0);">航班</a></h1>
                </div>
              </div>
              <div class="hlfVPad">
              	<table cellpadding="0" cellspacing="0" style="width:500px;">
				    <tr style="height:30px;">
					  <td style="width:100px;">航空公司</td>
					  <td style="width:150px;">1</td>
					  <td style="width:100px;">航班号</td>
					  <td style="width:150px;">2</td>
				    </tr>
				    <tr style="height:30px;">
				  	  <td>起飞时间</td>
					  <td>3</td>
					  <td>到达时间</td>
					  <td>4</td>
				    </tr>
				  </table>
              </div>
              <div class="itemimg Dtime"><img width="31" height="30" src="<%=request.getContextPath() %>/front/images/clear.gif" class=" fLt ico air_ico" alt=""><span class="_plan_time">13:00</span></div>
            </div>
          </div>
          
          <div class="trip_item blue">
            <div class="bgWht">
              <div class="wht">
                <div class="fLt ">
                  <h1><a href="javascript:void(0);">酒店</a></h1>
                </div>
              </div>
              <div class="hlfVPad">
                <table cellpadding="0" cellspacing="0" style="width:500px;">
				    <tr style="height:30px;">
					  <td style="width:100px;">酒店名称</td>
					  <td style="width:150px;">1</td>
					  <td style="width:100px;">房间名称</td>
					  <td style="width:150px;">2</td>
				    </tr>
				    <tr style="height:30px;">
					  <td style="width:100px;">酒店地址</td>
					  <td style="width:400px;" colspan="3">3</td>
				    </tr>
				    <tr style="height:30px;">
					  <td>入住时间</td>
					  <td>4</td>
					  <td>离开时间</td>
					  <td>5</td>
					</tr>
				  </table>
             </div>
              <div class="itemimg Dtime"><img width="31" height="30" src="<%=request.getContextPath() %>/front/images/clear.gif" class=" fLt ico res_ico" alt=""><span class="_plan_time">13:00<span></div>
            </div>
          </div>
          
          <div class="trip_item gray">
            <div class="bgWht">
              <div class="wht">
                <div class="fLt ">
                  <h1><a href="javascript:void(0);">会议</a></h1>
                </div>
              </div>
              <div class="hlfVPad">
                <table cellpadding="0" cellspacing="0" style="width:500px;">
				    <tr style="height:30px;">
					  <td style="width:100px;">会议时间</td>
					  <td style="width:400px;">1</td>
				    </tr>
				    <tr>
					  <td>会议内容</td>
					  <td>2</td>
				    </tr>
			      </table>
             </div>
              <div class="itemimg Dtime"><img width="31" height="30" src="<%=request.getContextPath() %>/front/images/clear.gif" class=" fLt ico meeting_ico" alt=""><span class="_plan_time">13:00</span></div>
            </div>
          </div>
          
          <div class="trip_item yellow">
            <div class="bgWht">
              <div class="wht">
                <div class="fLt ">
                  <h1><a href="javascript:void(0);">记录</a></h1>
                </div>
              </div>
              <div class="hlfVPad">
                <table cellpadding="0" cellspacing="0" style="width:500px;">
				    <tr style="height:30px;">
					  <td style="width:100px;">记录时间</td>
					  <td style="width:400px;">1</td>
				    </tr>
				    <tr>
					  <td>记录内容</td>
					  <td>2</td>
				    </tr>
				  </table>
             </div>
              <div class="itemimg Dtime"><img width="31" height="30" src="<%=request.getContextPath() %>/front/images/clear.gif" class=" fLt ico note_ico" alt=""><span class="_plan_time">13:00</span></div>
            </div>
          </div>
          
        </div> -->
        
        
      </div>
    </div>
    
    <jsp:include page="include/main-right.jsp" />
  </div>
  
  <jsp:include page="include/bottom.jsp" />
</div>

<!-- template -->
<div class="trip_day" id="planDateTpl_day" style="display:none;">
  <div class="bgBlu TripPad">
    <div class="fLt" style="width:150px">2011年11月6日</div>
    <div style="width: 350px;" class="fLt"> </div>
  </div>
</div>

<div class="trip_item blue" id="planDateTpl_flight" rel="" style="display:none;">
	<div class="bgWht">
		<div class="wht">
			<div class="fLt ">
				<h1><a href="javascript:void(0);">航班(出发)</a></h1>
			</div>
			<div class="fRt TripPad"><span class="_plan_notify" /></div>
        </div>
        <div class="hlfVPad">
        	<table cellpadding="0" cellspacing="0" style="width:500px;">
				<tr style="height:30px;">
					<td style="width:100px;">航空公司</td>
					<td style="width:150px;">1</td>
					<td style="width:100px;">航班号</td>
					<td style="width:150px;">2</td>
				</tr>
				<tr style="height:30px;">
					<td>起飞时间</td>
					<td>3</td>
					<td>到达时间</td>
					<td>4</td>
				</tr>
			</table>
        </div>
        <div class="itemimg Dtime"><img width="31" height="30" src="<%=request.getContextPath() %>/front/images/clear.gif" class=" fLt ico air_ico" alt=""><span class="_plan_time">13:00</span></div>
	</div>
</div>

<div class="trip_item blue" id="planDateTpl_flight2" rel="" style="display:none;">
	<div class="bgWht">
		<div class="wht">
			<div class="fLt ">
				<h1><a href="javascript:void(0);">航班(到达)</a></h1>
			</div>
        </div>
        <div class="hlfVPad">
        	<table cellpadding="0" cellspacing="0" style="width:500px;">
				<tr style="height:30px;">
					<td style="width:100px;">航空公司</td>
					<td style="width:150px;">1</td>
					<td style="width:100px;">航班号</td>
					<td style="width:150px;">2</td>
				</tr>
				<tr style="height:30px;">
					<td>起飞时间</td>
					<td>3</td>
					<td>到达时间</td>
					<td>4</td>
				</tr>
			</table>
        </div>
        <div class="itemimg Dtime"><img width="31" height="30" src="<%=request.getContextPath() %>/front/images/clear.gif" class=" fLt ico air_ico" alt=""><span class="_plan_time">13:00</span></div>
	</div>
</div>

<div class="trip_item blue" id="planDateTpl_hotel" rel="" style="display:none;">
	<div class="bgWht">
		<div class="wht">
			<div class="fLt ">
				<h1><a href="javascript:void(0);">酒店(入住)</a></h1>
			</div>
			<div class="fRt TripPad"><span class="_plan_notify" /></div>
		</div>
		<div class="hlfVPad">
			<table cellpadding="0" cellspacing="0" style="width:500px;">
				<tr style="height:30px;">
					<td style="width:100px;">酒店名称</td>
					<td style="width:150px;">1</td>
					<td style="width:100px;">房间名称</td>
					<td style="width:150px;">2</td>
				</tr>
				<tr style="height:30px;">
					<td style="width:100px;">酒店地址</td>
					<td style="width:400px;" colspan="3">3</td>
				</tr>
				<tr style="height:30px;">
					<td>入住时间</td>
					<td>4</td>
					<td>离开时间</td>
					<td>5</td>
				</tr>
			</table>
        </div>
        <div class="itemimg Dtime"><img width="31" height="30" src="<%=request.getContextPath() %>/front/images/clear.gif" class=" fLt ico res_ico" alt=""><span class="_plan_time">13:00</span></div>
	</div>
</div>

<div class="trip_item blue" id="planDateTpl_hotel2" rel="" style="display:none;">
	<div class="bgWht">
		<div class="wht">
			<div class="fLt ">
				<h1><a href="javascript:void(0);">酒店(离开)</a></h1>
			</div>
		</div>
		<div class="hlfVPad">
			<table cellpadding="0" cellspacing="0" style="width:500px;">
				<tr style="height:30px;">
					<td style="width:100px;">酒店名称</td>
					<td style="width:150px;">1</td>
					<td style="width:100px;">房间名称</td>
					<td style="width:150px;">2</td>
				</tr>
				<tr style="height:30px;">
					<td style="width:100px;">酒店地址</td>
					<td style="width:400px;" colspan="3">3</td>
				</tr>
				<tr style="height:30px;">
					<td>入住时间</td>
					<td>4</td>
					<td>离开时间</td>
					<td>5</td>
				</tr>
			</table>
        </div>
        <div class="itemimg Dtime"><img width="31" height="30" src="<%=request.getContextPath() %>/front/images/clear.gif" class=" fLt ico res_ico" alt=""><span class="_plan_time">13:00</span></div>
	</div>
</div>

<div class="trip_item blue" id="planDateTpl_hotel_during" rel="" style="display:none;">
	<div class="bgWht">
		<div class="wht">
			<div class="fLt ">
				<h1><a href="javascript:void(0);">酒店</a></h1>
			</div>
			<div class="fRt TripPad"><a class="_plan_del" href="javascript:void(0);">删除</a></div>
		</div>
		<div class="hlfVPad">
			<table cellpadding="0" cellspacing="0" style="width:500px;">
				<tr style="height:30px;">
					<td style="width:100px;">酒店名称</td>
					<td style="width:150px;">1</td>
					<td style="width:100px;">房间名称</td>
					<td style="width:150px;">2</td>
				</tr>
				<tr style="height:30px;">
					<td style="width:100px;">酒店地址</td>
					<td style="width:400px;" colspan="3">3</td>
				</tr>
				<tr style="height:30px;">
					<td>入住时间</td>
					<td>4</td>
					<td>离开时间</td>
					<td>5</td>
				</tr>
			</table>
        </div>
        <div class="itemimg Dtime"><img width="31" height="30" src="<%=request.getContextPath() %>/front/images/clear.gif" class=" fLt ico res_ico" alt=""><span class="_plan_time">13:00</span></div>
	</div>
</div>

<div class="trip_item gray" id="planDateTpl_meeting" rel="" style="display:none;">
	<div class="bgWht">
		<div class="wht">
			<div class="fLt ">
				<h1><a href="javascript:void(0);">会议</a></h1>
			</div>
			<div class="fRt TripPad"><span class="_plan_notify" /></div>
		</div>
		<div class="hlfVPad">
			<table cellpadding="0" cellspacing="0" style="width:500px;">
				<tr style="height:30px;">
					<td style="width:100px;">会议时间</td>
					<td style="width:400px;">1</td>
				</tr>
				<tr>
					<td>会议内容</td>
					<td>2</td>
				</tr>
			</table>
		</div>
		<div class="itemimg Dtime"><img width="31" height="30" src="<%=request.getContextPath() %>/front/images/clear.gif" class=" fLt ico meeting_ico" alt=""><span class="_plan_time">13:00</span></div>
	</div>
</div>

<div class="trip_item yellow" id="planDateTpl_note" rel="" style="display:none;">
	<div class="bgWht">
		<div class="wht">
			<div class="fLt ">
				<h1><a href="javascript:void(0);">记录</a></h1>
			</div>
			<div class="fRt TripPad"><span class="_plan_notify" /></div>
		</div>
		<div class="hlfVPad">
			<table cellpadding="0" cellspacing="0" style="width:500px;">
				<tr style="height:30px;">
					<td style="width:100px;">记录时间</td>
					<td style="width:400px;">1</td>
				</tr>
				<tr>
					<td>记录内容</td>
					<td>2</td>
				</tr>
			</table>
		</div>
		<div class="itemimg Dtime"><img width="31" height="30" src="<%=request.getContextPath() %>/front/images/clear.gif" class=" fLt ico note_ico" alt=""><span class="_plan_time">13:00</span></div>
	</div>
</div>
          
<div id="opDiv" class="pop dialog" style="height:100px;width:200px;display:none;">
	<div class="popHeader"><h1>提示</h1><a href="javascript:void(0);hiddenPopDiv('opDiv');"><span class="close">关闭</span></a></div>
	<div style="margin:10px 0 0 10px;width:200px;">
		<span style="font-size:14px;color:red;" id="opDiv_span">正在操作,请稍等.</span>
		<br/>
	</div>
</div>

<script type='text/javascript' src='<%=request.getContextPath() %>/dwr/interface/frontTripAction.js'></script>
<script type="text/javascript">
	var switchPop=function(a,b){
		hiddenPopDiv(a);
		showPopDiv(b);
	}
	
	var showOp=function(str){
		hiddenPopDiv();
		$('opDiv_span').set('html',str?str:'正在操作,请稍等.');
		showPopDiv('opDiv');
	}
	
	var tripId=<%=trip.getId()%>;
	
	var planListDiv=$('planListDiv');
	
	var genDay=function(a){
		var ymd=a[0]+a[1]+a[2];
		var dayId='trip_day_'+ymd;
		var day=planListDiv.getElement('#'+dayId);
		if(!day){
			day=$('planDateTpl_day').clone();
			day.set('id',dayId);
			day.setStyle('display','block');
			day.getElements('.fLt')[0].set('html',a[0]+'年'+a[1]+'月'+a[2]+'日');
			
			// inject
			var tf=0;
			var days=planListDiv.getElements('.trip_day');
			for(var i=0;i<days.length;i++){
				if(days[i].get('id')>dayId){
					day.inject(days[i],'before');
					tf=1;
					break;
				}
			}
			if(!tf){
				day.inject(planListDiv,'bottom');
			}
		}
		
		return day;
	}
	
	var genPlan=function(day,a,b,pid,type,notifyStatus){
		var ymd=a[0]+a[1]+a[2];
		var hs=b[0]+b[1];
		
		var planId='trip_plan_'+ymd+'_'+hs+'_'+type+'_'+pid;
		var plan=$('planDateTpl_'+type).clone();
		plan.set('id',planId);
		plan.set('rel','p_'+pid);
		plan.setStyle('display','block');
		plan.getElement('._plan_time').set('html',b[0]+':'+b[1]+'&nbsp;'+(b[0]>=12?'PM':'AM'));
		
		if(plan.getElement('._plan_notify')&&notifyStatus){
			plan.getElement('._plan_notify').set('html','通知');
		}
		
		// inject
		var tf=0;
		var dayPlans=day.getElements('.trip_item');
		for(var i=0;i<dayPlans.length;i++){
			if(dayPlans[i].get('id')>planId){
				plan.inject(dayPlans[i],'before');
				tf=1;
				break;
			}
			// last element
			if(i==dayPlans.length-1){
				plan.inject(dayPlans[i],'after');
				tf=1;
			}
		}
		if(!tf){
			plan.inject(day,'bottom');
		}
		
		return plan;
	}
	
	var renderPage_flight=function(pid, flight_time, arrive_time, airline, flight_number, notifyStatus){
		// flight_time
		var a=flight_time.split(' ')[0].split('-');
		var b=flight_time.split(' ')[1].split(':');
		var day=genDay(a);
		var plan=genPlan(day,a,b,pid,'flight', notifyStatus);

		// data
		var tbl=plan.getElement('table');
		tbl.getChildren()[0].getChildren()[0].getChildren()[1].set('html',airline);
		tbl.getChildren()[0].getChildren()[0].getChildren()[3].set('html',flight_number);
		tbl.getChildren()[0].getChildren()[1].getChildren()[1].set('html',flight_time);
		tbl.getChildren()[0].getChildren()[1].getChildren()[3].set('html',arrive_time);
		
		// arrive_time
		var c=arrive_time.split(' ')[0].split('-');
		var d=arrive_time.split(' ')[1].split(':');
		var day2=genDay(c);
		var plan2=genPlan(day2,c,d,pid,'flight2');

		// data
		var tbl2=plan2.getElement('table');
		tbl2.getChildren()[0].getChildren()[0].getChildren()[1].set('html',airline);
		tbl2.getChildren()[0].getChildren()[0].getChildren()[3].set('html',flight_number);
		tbl2.getChildren()[0].getChildren()[1].getChildren()[1].set('html',flight_time);
		tbl2.getChildren()[0].getChildren()[1].getChildren()[3].set('html',arrive_time);
	}
	
	var renderPage_hotel=function(pid, check_in_time, check_out_time, address, telephone, hotel_name, notifyStatus){
		// check_in_time
		var a=check_in_time.split(' ')[0].split('-');
		var b=check_in_time.split(' ')[1].split(':');
		var day=genDay(a);
		var plan=genPlan(day,a,b,pid,'hotel', notifyStatus);

		// data
		var tbl=plan.getElement('table');
		tbl.getChildren()[0].getChildren()[0].getChildren()[1].set('html',hotel_name);
		tbl.getChildren()[0].getChildren()[0].getChildren()[3].set('html',telephone);
		tbl.getChildren()[0].getChildren()[1].getChildren()[1].set('html',address);
		tbl.getChildren()[0].getChildren()[2].getChildren()[1].set('html',check_in_time);
		tbl.getChildren()[0].getChildren()[2].getChildren()[3].set('html',check_out_time);
		
		// check_out_time
		var c=check_out_time.split(' ')[0].split('-');
		var d=check_out_time.split(' ')[1].split(':');
		var day2=genDay(c);
		var plan2=genPlan(day2,c,d,pid,'hotel2');

		// data
		var tbl2=plan2.getElement('table');
		tbl2.getChildren()[0].getChildren()[0].getChildren()[1].set('html',hotel_name);
		tbl2.getChildren()[0].getChildren()[0].getChildren()[3].set('html',telephone);
		tbl2.getChildren()[0].getChildren()[1].getChildren()[1].set('html',address);
		tbl2.getChildren()[0].getChildren()[2].getChildren()[1].set('html',check_in_time);
		tbl2.getChildren()[0].getChildren()[2].getChildren()[3].set('html',check_out_time);
		
		// during
		var sDate=new Date();
		sDate.setFullYear(a[0],a[1],a[2]);
		sDate.setDate(sDate.getDate()+1);
		var eDate=new Date();
		eDate.setFullYear(c[0],c[1],c[2]);
		eDate.setDate(eDate.getDate());
		
		while(sDate<eDate){
			var _y=sDate.getFullYear()+'';
			var _m=sDate.getMonth();
			_m=_m<10?'0'+_m:''+_m;
			var _d=sDate.getDate();
			_d=_d<10?'0'+_d:''+_d;
			var e=[_y,_m,_d];
			var f=['00','00'];
			var _day=genDay(e);
			var _plan=genPlan(_day,e,f,pid,'hotel_during');
	
			// data
			var _tbl=_plan.getElement('table');
			_tbl.getChildren()[0].getChildren()[0].getChildren()[1].set('html',hotel_name);
			_tbl.getChildren()[0].getChildren()[0].getChildren()[3].set('html',telephone);
			_tbl.getChildren()[0].getChildren()[1].getChildren()[1].set('html',address);
			_tbl.getChildren()[0].getChildren()[2].getChildren()[1].set('html',check_in_time);
			_tbl.getChildren()[0].getChildren()[2].getChildren()[3].set('html',check_out_time);
			
			sDate.setDate(sDate.getDate()+1);
		}
	}
	
	var renderPage_meeting=function(pid, meeting_time, meeting_info, notifyStatus){
		var a=meeting_time.split(' ')[0].split('-');
		var b=meeting_time.split(' ')[1].split(':');
		var day=genDay(a);
		var plan=genPlan(day,a,b,pid,'meeting', notifyStatus);

		// data
		var tbl=plan.getElement('table');
		tbl.getChildren()[0].getChildren()[0].getChildren()[1].set('html',meeting_time);
		tbl.getChildren()[0].getChildren()[1].getChildren()[1].set('html',meeting_info);
	}
	
	var renderPage_note=function(pid, note, note_time, notifyStatus){
		var a=note_time.split(' ')[0].split('-');
		var b=note_time.split(' ')[1].split(':');
		var day=genDay(a);
		var plan=genPlan(day,a,b,pid,'note', notifyStatus);

		// data
		var tbl=plan.getElement('table');
		tbl.getChildren()[0].getChildren()[0].getChildren()[1].set('html',note_time);
		tbl.getChildren()[0].getChildren()[1].getChildren()[1].set('html',note);
	}
	
	// gen days
<%
	Calendar startCal = Calendar.getInstance();
	startCal.setTime(startDate);
	Calendar endCal = Calendar.getInstance();
	endCal.setTime(endDate);
	endCal.add(Calendar.DATE,1);
	
	while(startCal.before(endCal)){
		String[] _s = sdf.format(startCal.getTime()).split("-");
%>
	genDay(['<%=_s[0]%>','<%=_s[1]%>','<%=_s[2]%>']);
<%
		startCal.add(Calendar.DATE,1);
	}
%>
	
	
	// planList
<%
	List<TripPlan> planList = (List<TripPlan>)request.getAttribute("planList");
	SimpleDateFormat sdf2 = new SimpleDateFormat("yyyy-MM-dd HH:mm");
	
	for(TripPlan plan : planList){
		String type = plan.getType();
		if(TripPlan.TYPE_FLIGHT.equals(type)){
			TripPlanFlight flight = plan.getFlight();
%>
	renderPage_flight('<%=plan.getId()%>','<%=sdf2.format(flight.getFlightTime())%>','<%=sdf2.format(flight.getArriveTime())%>','<%=flight.getAirline()%>','<%=flight.getFlightNumber()%>',<%=plan.getNotifyStatus()%>);
<%
		}else if(TripPlan.TYPE_HOTEL.equals(type)){
			TripPlanHotel hotel = plan.getHotel();
%>
	renderPage_hotel('<%=plan.getId()%>','<%=sdf2.format(hotel.getCheckInTime())%>','<%=sdf2.format(hotel.getCheckOutTime())%>','<%=hotel.getAddress()%>','<%=hotel.getRoomName()%>','<%=hotel.getHotelName()%>',<%=plan.getNotifyStatus()%>);
<%
		}else if(TripPlan.TYPE_MEETING.equals(type)){
			TripPlanMeeting meeting = plan.getMeeting();
%>
	renderPage_meeting('<%=plan.getId()%>','<%=sdf2.format(meeting.getMeetingTime())%>','<%=meeting.getMeetingInfo()%>',<%=plan.getNotifyStatus()%>);
<%
		}else if(TripPlan.TYPE_NOTE.equals(type)){
			TripPlanNote note = plan.getNote();
%>
	renderPage_note('<%=plan.getId()%>','<%=note.getNote()%>','<%=sdf2.format(note.getNoteTime())%>',<%=plan.getNotifyStatus()%>);
<%
		}
	}
%>

	// weather
	frontTripAction.queryCityWeather(<%=trip.getToCity()%>,function(res){
		res=eval('('+res+')');
		if(res&&res.Stat=='OK'){
			var ws=res.Weathers[0].Forecast;
			for(var i=0;i<ws.length;i++){
				var w=ws[i];
				var d=w.Date;
				var _d=new Date(d.substring(6,d.length-7).toInt()+800);
				var _dy=_d.getFullYear();
				var _dm=_d.getMonth()+1;
				_dm=_dm<10?'0'+_dm:''+_dm;
				var _dd=_d.getDate();
				_dd=_dd<10?'0'+_dd:''+_dd;
				var ymd=_dy+_dm+_dd;
				
				var day=planListDiv.getElement('#trip_day_'+ymd);
				if(day){
					day.getElements('.fLt')[1].set('html',w.High+'/'+w.Low+'°C '+w.Text);
				}
			}
		}
	});
	
	var goPrint=function(){
		//window.print();
		window.open('<%=request.getContextPath() %>/front/trip!print.action?id=<%=trip.getId()%>','_blank');
	}
</script>
</body>
</html>